
package com.zzyl.service.impl;

import com.zzyl.mapper.MemberMapper;
import com.zzyl.entity.Member;
import com.zzyl.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class MemberServiceImpl implements MemberService {

    @Autowired
    private MemberMapper memberMapper;

    @Override
    public Member saveMember(Member member) {
        memberMapper.insert(member);
        return member;
    }

    @Override
    public Member getByOpenId(String openId) {
        return memberMapper.getByOpenId(openId);
    }

    @Override
    public Member updateMember(Member member) {
        memberMapper.update(member);
        return member;
    }

    @Override
    public void deleteMemberByOpenId(String openId) {
        memberMapper.deleteByOpenId(openId);
    }

    @Override
    public List<Member> listAllMembers() {
        return memberMapper.getAllMembers();
    }

    @Override
    public List<Member> listMembersByCreateBy(Long createBy) {
        return memberMapper.getByCreateBy(createBy);
    }
}